package cn.mrlong.base.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * 作者：BINGO
 * 时间：2021/03/29 16:14
 */
class TitleViewModel : ViewModel() {
    val leftButtonAction = MutableLiveData<Boolean>()
    val titleName = MutableLiveData<String>()
    val rightButtonText = MutableLiveData<String>()
    val rightButtonAction: MutableLiveData<Boolean> = MutableLiveData<Boolean>()
    val rightButtonVisibility: MutableLiveData<Boolean> = MutableLiveData<Boolean>()
    fun liftButtonClick() {
        leftButtonAction.value = true
    }

    fun rightBtnOnClick() {
        if (null == rightButtonAction.value) {
            rightButtonAction.value = false
        } else {
            rightButtonAction.value = !rightButtonAction.value!!
        }
    }
}